package com.exam.api.common.poster;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Author bcheng
 * @Create 2024/1/10 16:41
 * @Description 矩形元素
 */
@Schema(description = "矩形元素")
@EqualsAndHashCode(callSuper = true)
@Data
public class Rectangle extends ZIndex{

    /**
     * 宽度
     */
    @Schema(description = "宽度")
    @NotNull(message = "图片宽度不能为空")
    private Integer width;

    /**
     * 高度
     */
    @Schema(description = "高度")
    @NotNull(message = "图片高度不能为空")
    private Integer height;

    /**
     * x 坐标
     */
    @Schema(description = "x 坐标")
    @NotNull(message = "文本X坐标不能为空")
    private int x = 0;

    /**
     * y 坐标
     */
    @Schema(description = "y 坐标")
    @NotNull(message = "文本Y坐标不能为空")
    private int y = 0;

    /**
     * 颜色
     */
    @Schema(description = "颜色")
    @NotNull(message = "文本字体颜色不能为null")
    private String color = "#000000";


    /**
     * 圆角
     */
    @Schema(description = "圆角")
    @Min(value = 0, message = "图片圆角不能小于0")
    private Integer borderRadius = 0;

    /**
     * 透明度
     */
    @Schema(description = "透明度")
    @Min(value = 0, message = "图片圆角不能小于0")
    private float alpha = 1.0f;
}
